<?php
/*
 * @model Post
 */
?>
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'edit-form',
	'enableClientValidation' => true,
	'clientOptions'=> array('validateOnSubmit'=>true),
	'htmlOptions' => array('class'=>'form-horizontal')
)); ?>
<div class="box">
	<div class="box-title">
		<h4><i class="icon-briefcase"></i>Atributes</h4>
	</div>
	<div class="box-content">
		<div class="control-group">
			<?php echo $form->labelEx($model,'category_id', array('class'=>'control-label')); ?>
			<div class="controls">
				<?php echo $form->dropDownList($model,'category_id', $model->getCategoryListData(), array('encode'=>false,'empty'=>'')); ?>
				<?php echo $form->error($model,'category_id'); ?>
				<p><input type="checkbox" id="chk1" checked="checked" onclick="toggleFieldEditMode.call(this, 'MassUpdateForm[category_id]')"> <label for="chk1">Update</label></p>
			</div>
		</div>

		<div class="control-group">
			<?php echo $form->labelEx($model,'status', array('class'=>'control-label')); ?>
			<div class="controls">
				<?php echo $form->radioButtonList($model, 'status', $model->getStatusListData(), Helper::getRadioOptions() ); ?>
				<?php echo $form->error($model,'status'); ?>
				<p><input type="checkbox" id="chk2" checked="checked" onclick="toggleFieldEditMode.call(this, 'MassUpdateForm[status]')"> <label for="chk2">Update</label></p>
			</div>
		</div>

		<div class="control-group">
			<?php echo $form->labelEx($model,'rating', array('class'=>'control-label')); ?>
			<div class="controls">
				<?php echo $form->dropDownList($model,'rating', $model->getRatingListData(), array('empty'=>'')); ?>
				<?php echo $form->error($model,'rating'); ?>
				<p><input type="checkbox" id="chk3" checked="checked" onclick="toggleFieldEditMode.call(this, 'MassUpdateForm[rating]')"> <label for="chk3">Update</label></p>
			</div>
		</div>

		<div class="control-group">
			<?php echo $form->labelEx($model,'visibility', array('class'=>'control-label')); ?>
			<div class="controls">
				<?php echo $form->dropDownList($model,'visibility', $model->getVisibilityListData(), array('empty'=>'')); ?>
				<?php echo $form->error($model,'visibility'); ?>
				<p><input type="checkbox" id="chk4" checked="checked" onclick="toggleFieldEditMode.call(this, 'MassUpdateForm[visibility]')"> <label for="chk4">Update</label></p>
			</div>
		</div>
	</div>
</div>
<?php $this->endWidget(); ?>
<script type="text/javascript">
//<![CDATA[
function toggleFieldEditMode(field) {
	if (this.checked)
		$('[name="'+field+'"]').removeAttr('disabled');
	else
		$('[name="'+field+'"]').attr('disabled','disabled');
}
//]]>
</script> 